<template>
  <div class="linkage">
    <div>
      <el-select v-model="item.domain"
                 default-first-option
                 filterable
                 value-key="domainId"
                 style="width:600px"
                 placeholder="请选择专业领域">
        <el-option v-for="item in domainList" :key="item.domainId" :label="item.domainName" :value="item"></el-option>
      </el-select>
    </div>
  </div>
</template>

<script>
export default {
  name: "DomainSelector",
  props: ['item'],
  data() {
    return {
      domainList:[],
    }
  },
  created() {
    let url = '';
    if (this.item.expertId){
      url = 'api/expertDomain/list';
    } else if (this.item.teamId){
      url = 'api/teamDomain/list';
    }
    this.$http.get(url).then(res =>{
      if (res.data.code===200){
        this.domainList = res.data.data;
      }
    })
  }
}
</script>

<style scoped>

</style>